When loading a GResource-backed GFileIcon into a GtkIconInfo we
currently fail to populate the is_resource private field.
Also, since is_svg is set by looking at the filename, and
g_file_get_path() returns NULL for a GResourceFile, is_svg was always
FALSE.
https://bugzilla.gnome.org/show_bug.cgi?id=744991
if (file != NULL)
{
info->icon_file = g_object_ref (file);
- info->filename = g_file_get_path (file);
+ info->is_resource = g_file_has_uri_scheme (file, "resource");
+
+ if (info->is_resource)
+ {
+ gchar *uri;
+
+ uri = g_file_get_uri (file);
+ info->filename = g_strdup (uri + 11); /* resource:// */
+ g_free (uri);
+ }
+ else
+ {
+ info->filename = g_file_get_path (file);
+ }
+
info->is_svg = suffix_from_name (info->filename) == ICON_SUFFIX_SVG;
}
}